"""file_share URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls.static import static
from django.views.static import serve

from main_show import views as main_sh
from file_share import settings
from django.conf.urls import include, url

urlpatterns = [
    path(r'admin/', admin.site.urls),
    url(r'files/(?P<path>.*)', serve, {'document_root': settings.MEDIA_ROOT}),
    path('', main_sh.show, name='shouye'),
    path('receive_upload_to_local/', main_sh.receive_upload_to_local, name='receive_upload_to_local'),
    path('render_upload/', main_sh.render_upload, name='render_upload'),
    path('folder_show/', main_sh.folder_show, name='folder_show'),
    path('creat_new_folder/', main_sh.creat_new_folder, name='creat_new_folder'),
    path('del_file/', main_sh.del_file, name='del_file'),
    path('rename_folder/', main_sh.rename_folder, name='rename_folder'),
    path('download_file/', main_sh.download_file, name='download_file'),
    path('folder_to_zip/', main_sh.folder_to_zip, name='folder_to_zip'),
    path('echo/', main_sh.echo, name='echo'),
]
# urlpatterns += static('/img/', document_root=settings.MEDIA_ROOT)
